package net.cnki.sunny.base;

import org.springframework.beans.factory.annotation.Autowired;
import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;

public class BaseService<T> {

    @Autowired
    private BaseMapper<T> baseMapper;

    public List<T> selectAll() {
        return baseMapper.selectAll();
    }

    public T selectByPrimaryKey(Integer primaryKey) {
        return baseMapper.selectByPrimaryKey(primaryKey);
    }

    public T selectOne(T t) {
        return baseMapper.selectOne(t);
    }

    public List<T> select(T t) {
        return baseMapper.select(t);
    }

    public Boolean existsWithPrimaryKey(Integer primaryKey) {
        return baseMapper.existsWithPrimaryKey(primaryKey);
    }

    public Integer selectCount(T t) {
        return baseMapper.selectCount(t);
    }

    public Integer insert(T t) {
        return baseMapper.insert(t);
    }

    public Integer insertSelective(T t) {
        return baseMapper.insertSelective(t);
    }

    public Integer updateByPrimaryKeySelective(T t) {
        return baseMapper.updateByPrimaryKeySelective(t);
    }

    public Integer deleteByPrimaryKey(Integer id) {
        return baseMapper.deleteByPrimaryKey(id);
    }
}
